package com.hspedu.extends_;

abstract class Employee {
    public String name;
    public int id;
    public double pay;

    Employee(String name,int id,double pay)
    {
        this.name = name;
        this.id = id;
        this.pay = pay;
    }

    public abstract void work();
}

class Manager extends Employee
{
    public double bonus;

    Manager(String name,int id,double pay,double bonus)
    {
        super(name,id,pay);
        this.bonus = bonus;
    }
    public void work()
    {
        System.out.println("name:"+this.name+"   id:" +this.id+"   pay: "+this.pay+"  bonus: " +bonus);
        System.out.println("Manager work  ......");
    }
}

class Programmer extends Employee
{
    Programmer(String name,int id,double pay)
    {
        super(name,id,pay);
    }
    public void work()
    {
        System.out.println("name: "+this.name+"  id: " +this.id+"  pay: "+this.pay );
        System.out.println("Programmer work ......");
        System.out.println();
    }

}

class Toolman
{
    public static void main(String[] args)
    {
        Programmer a = new Programmer("xiaoming",001,5000.00);
        a.work();
        Manager m = new Manager("xiaohong",010,8000.00,600.00);
        m.work();
    }
}